/*************
Ten tac gia : LY THIEN KIM
Ngay tao : 8/16/2011
Noi dung : update 1 LIST_CRIME

*************/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE NAME = 'sp_UpdateLIST_CRIME')
BEGIN
	DROP PROC sp_UpdateLIST_CRIME
END
GO
CREATE PROC sp_UpdateLIST_CRIME
	@ID				int,
	@IDCRIME		int,
	@IMPRISONMENT	int,
	@Name			varchar(40),
	@Last_updated	datetime,
	@Result			int out
	AS
	BEGIN	
		IF EXISTS (SELECT * FROM LIST_CRIME WHERE ID = @ID and IDCRIME = @IDCRIME)
		BEGIN
			UPDATE LIST_CRIME SET  IMPRISONMENT = @IMPRISONMENT,Name = @Name,Last_updated = @Last_updated
			WHERE ID = @ID and IDCRIME = @IDCRIME
			SET @Result = 1	
		END
		else
		BEGIN
			SET @Result = 0
		END
	END